const mongoose = require('mongoose')

const schema = new mongoose.Schema({
  name: { type: String },
  title: { type: String }, // 称呼
  avatar: { type: String }, // 头像
  banner: { type: String }, // 大图
  categories: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'Category'}], // 类型
  scores: { // 评分
    difficult: { type: Number },
    skills: { type: Number },
    attack: { type: Number },
    survive: { type: Number }
  },
  skills: [{ // 技能
    icon: { type: String },
    name: { type: String },
    delay: { type: String },
    cost: { type: String },
    description: { type: String },
    tips: { type: String },
  }],
  items1: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'Item'}], // 顺风出装
  items2: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'Item'}],  // 逆风出装
  usageTips: { type: String }, // 使用技巧
  battleTips: { type: String }, // 对抗技巧
  teamTips: { type: String }, // 团战思路
  partners: [{ // 最佳搭档
    hero: { type: mongoose.SchemaTypes.ObjectId, ref: 'Hero'},
    description: { type: String }
  }]
})

module.exports = mongoose.model('Hero', schema, 'heroes')